/*
 +----------------------------------------------------------------------
 + Title        : notify
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2024-12-11
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 通知接口
 +----------------------------------------------------------------------
*/

import type { ApiResponse } from "@/types/global"
import type { EditNotifyParams, NotifyListParams, NotifyListResult, NotifyTotalResult, PublishNotifyParams } from "@/types/notify"
import request from '@/utils/httpRequest'


/**
 * 发布,请求方式[POST]
 * 
 * @param PublishNotifyParams data -------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqPublishNotifyAPI = (data: PublishNotifyParams) => {
    return request<any, ApiResponse<any>>({
        method: 'POST',
        url: 'notify/publish',
        data
    })
}

/**
 * 删除,请求方式[GET]
 * 
 * @param string ids -------------------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqDeleteNotifyAPI = (ids: string) => {
    return request<any, ApiResponse<any>>({
        method: 'GET',
        url: 'notify/delete',
        params: {ids}
    })
}

/**
 * 编辑,请求方式[GET]
 * 
 * @param EditNotifyParams data --------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqEditNotifyAPI = (data: EditNotifyParams) => {
    return request<any, ApiResponse<any>>({
        method: 'POST',
        url: 'notify/edit',
        data
    })
}

/**
 * 详情,请求方式[GET]
 * 
 * @param number id --------------------------------------------请求参数
 * @returns <any, ApiResponse<any>>
 * @author huwl
 */
export const reqNotifyDetailAPI = (id: number) => {
    return request<any, ApiResponse<any>>({
        method: 'GET',
        url: 'notify/detail',
        params: {id}
    })
}

/**
 * 列表,请求方式[GET]
 * 
 * @param NotifyListParams params -------------------------请求参数
 * @returns <any, ApiResponse<notifyListResult>>
 * @author huwl
 */
export const reqNotifyListAPI = (params: NotifyListParams) => {
    return request<any, ApiResponse<NotifyListResult>>({
        method: 'GET',
        url: 'notify/list',
        params
    })
}

/**
 * 数量,请求方式[GET]
 * 
 * @param NotifyListParams params -------------------------请求参数
 * @returns <any, ApiResponse<NotifyTotalResult>>
 * @author huwl
 */
export const reqNotifyTotalAPI = (params: NotifyListParams) => {
    return request<any, ApiResponse<NotifyTotalResult>>({
        method: 'GET',
        url: 'notify/total',
        params
    })
}